<?php
class Setting extends AppModel{
    public $useTable  = 'setting';
    public $lang_code = 'vn';
    
    
    public function get_setting()
    {
        $lang_code = $this->lang_code;
        $sql = 'SELECT * FROM setting where lang_code = "'.$lang_code.'" OR lang_code = ""';
        $settings = $this->query($sql);
        $setting = array();
        foreach($settings as $value)
        {
            $k = $value['setting']['key'];
            $v = $value['setting']['value'];
            $setting[$k] = $v;
        }
        return $setting;
    }
}
    